package com.baitengsoft.patentapimonitor.api.dao;

import com.baitengsoft.patentapimonitor.api.entity.PacApplicantEntity;
import com.baitengsoft.patentapimonitor.api.model.*;
import com.baitengsoft.patentapimonitor.api.model.param.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by QEK on 2017/12/20.
 */
@Mapper
@Repository
public interface PacApplicantDao extends BasetkRepository<PacApplicantEntity> {

    List<PacApplicantModel> selectPacApplicant(SearchApplicantParam param);

    int classifyByIndustry(ClassifyByIndustryParam param);

    int classifyByArea(ClassifyByAreaParam param);

    int classifyByType(ClassifyByTypeParam param);

    List<String> selectTypeLevel2NameByIds(List<Integer> typeLevel2Ids);

    PacApplicantModel selectPacApplicantById(Integer id);

    int updateIndustryToZero(Integer industryId);

    int updateAreaIdToZero(Integer areaId);

    //权力人报表
    List<WebApplicantInfo> getApplicantRptList(@Param("platformId") Integer platfromId, @Param("param") SearchApplicantAnalysisParam param);

    /**
     * 权力人行业分类
     */
    List<WebApplicantIndustryInfo> getApplicantIndustry(@Param("platformId") Integer platfromId, @Param("dataTypeValue")Integer dataTypeValue);

    /**
     * 权力人类型分类
     */
    WebApplicantTypeInfo getTotalInfoByType(@Param("platformId") Integer platfromId, @Param("dataTypeValue")Integer dataTypeValue);

    /**
     * 权力人类型分布 分类信息
     */
    WebApplicantTypeInfo getApplicantTypeList(@Param("platformId") Integer platfromId,
                                                    @Param("dataTypeValue")Integer dataTypeValue,
                                                    @Param("typeId")Integer typeId);

    List<WebApplicantTypeInfo> getApplicantTypeList_1(@Param("platformId") Integer platfromId,@Param("dataTypeValue")Integer dataTypeValue);
    /**
     * 概览权力人分析
     */
    List<WebApplicantAnalysisInfo> getApplicantAnalysis(@Param("platformId")Integer platformid, @Param("dataTypeValue")Integer dataTypeValue);

    /**
     * 分页查询
     */
    List<PacApplicantInfo> queryList(@Param("platformid") Integer platformid,@Param("param") SearchApplicantParam param);

    /**
     * 根据平台ID查询权力人ID列表
     */
    List<Integer> getApplicantIdsByPlatfromId(@Param("platformid") Integer platformid);

    /**
     * 区域归类
     */
    void classifyAreaByIds(@Param("ids") List<Integer> ids, @Param("areaId") Integer areaId);

}
